
function isSameWeek(date1,date2) {

    // todo
    const year1=parseInt(date1.slice(0,4))
    const month1=parseInt(date1.slice(4,6))-1
    const day1=parseInt(date1.slice(6))

    const year2=parseInt(date2.slice(0,4))
    const month2=parseInt(date2.slice(4,6))-1
    const day2=parseInt(date2.slice(6))

    const d1=new Date(year1,month1,day1)
    const d2=new Date(year2,month2,day2)


    const startYear1=new Date(year1,0,1)
    const startYear2=new Date(year2,0,1)

    const count1=Math.floor((d1-startYear1)/(1000*60*60*24))
    const count2=Math.floor((d2-startYear2)/(1000*60*60*24))

    const week1=Math.floor(count1/7)
    const week2=Math.floor(count2/7)

    return week1===week2 

}

console.log(isSameWeek("20250414", "20250415"))